from django.db import models


# TODO:这个数据模型是为了测试而临时建立的
class UserInfo(models.Model):
    username = models.CharField(verbose_name='⽤户名', max_length=32)
    email = models.EmailField(verbose_name='邮箱', max_length=32)
    mobile_phone = models.CharField(verbose_name='⼿机号', max_length=32)
    password = models.CharField(verbose_name='密码', max_length=32)


class Task(models.Model):
    '''日程记录：每一条数据都会被存储在时这个表中'''
    username = models.CharField(verbose_name='⽤户名', max_length=32)
    name = models.CharField(verbose_name='任务名', max_length=64, unique=False)  #任务名称
    # 关联⽤户表和任务表外键
    # on_delete=models.CASCADE设置级联删除
    start_datetime = models.DateTimeField(verbose_name='开始时间', null=True, blank = True)
    end_datetime = models.DateTimeField(verbose_name='结束时间', null=True,
                                     blank=True)
    text = models.CharField(verbose_name='任务描述',max_length=500,null=True,blank=True)  # 任务描述

class DateDesc(models.Model):
    username = models.CharField(verbose_name='⽤户名', max_length=32)
    des= models.CharField(verbose_name='当日总结', max_length=64, unique=False) #日程描述
    date=models.DateField(verbose_name='日期', null=True, blank = True)


